﻿@model ScmSpecialpersonnelViewModel
@{
    Layout = null;
    ViewBag.Title = "特种作业人员-列表";
}

@using (Html.BeginForm("SplitPage", "ScmSpecialPersonnel", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return divSearch(this,'tzgl_zyry_list');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <input type="hidden" name="input_section" value="@(ViewBag.Section)" />
    <ul class="searchBar">
        <li><span>姓名：</span>
            <input type="text" name="iput_name" value="@(ViewBag.iput_name)" />
        </li>
        <li><span>工种：</span>
            <input type="text" name="iput_work" value="@(ViewBag.iput_work)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
}
<div class="panelBar" style="border-top: none;">
    <ul class="toolBar">
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Create", "tzgl_zyry_add",
                    Url.Action("SpecialPersonnelAdd", "ScmSpecialPersonnel", new { Section = ViewBag.Section }),
                    "添加",
                    new Dictionary<string, object>
                    {
                        {"class","add"},{"rel","tzgl_zyry_add"} ,{"mask","true"},{"target","dialog"},{"width","400"},{"height","400"}
                    })
        </li>
        <li>
           @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Delete", "tzgl_zyry_delete",
                             Url.Action("SpecialPersonnelDelete", "ScmSpecialPersonnel", new { id = "{ids}" }),
                    "删除",
                    new Dictionary<string, object>
                    {
                        {"class","delete"},{"rel","ids"} ,{"title","确定要删除这些记录吗?"},{"target","ajaxTodo"},{"callback","function(){$('#pagerForm', navTab.getCurrentPanel()).submit();}"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Edit", "tzgl_zyry_edit",
                    Url.Action("SpecialPersonnelEdit", "ScmSpecialPersonnel", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_zyry_edit"} ,{"mask","true"},{"target","dialog"},{"width","400"},{"height","400"},{"warn","请选择一条信息！"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Detail", "tzgl_zyry_detail",
                    Url.Action("SpecialPersonnelDetail", "ScmSpecialPersonnel", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_zyry_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息！"}
                    })
        </li>
        <li class="line">line</li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Download", "tzgl_zyry_download",
                    "../../Areas/SafetyConstruction/Upload/特种作业人员台账.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","导入模板下载"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Input", "tzgl_zyry_input",
                    Url.Action("Index", "Import", new { url = "/ScmSpecialPersonnel/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_zyry_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmSpecialPersonnel.Export", "tzgl_zyry_export",
                    Url.Action("Excel", "ScmSpecialPersonnel", new { Section = ViewBag.Section, danwei = ViewBag.danwei }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
        </li>
    </ul>
</div>
<div class="panelBar" style="border-top:none;">
    <ul class="toolBar">
        <li class="nobg"><b>标段：@ViewBag.Section</b></li>
        <li class="nobg" style="float:right;"><b>施工单位：@ViewBag.danwei</b></li>
    </ul>
</div>

<table class="table" width="100%" layouth="148" nowraptd="false" aria-relevant="tzgl_zyry_list">
    <thead>
        <tr>
            <th width="22" style="display:none">
                <input type="checkbox" group="ids" class="checkboxCtrl" />
            </th>
            <th width="30" align="center">
                序号
            </th>
            <th width="80" align="center">
                姓名
            </th>
            <th width="40" align="center">
                性别
            </th>
            <th width="80" align="center">
                工种
            </th>
            <th width="80" align="center">
                发证日期
            </th>
            <th width="80" align="center">
                有效期
            </th>
            <th width="100" align="center">
                证书编号
            </th>
            <th width="80" align="center">
                进场时间
            </th>
            <th width="80" align="center">
                退场时间
            </th>
        </tr>
    </thead>
    <tbody>
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.TheSpecialpersonnelList)
        {
            num += 1;
            <tr target="ids" rel="@item.Sp_ID">
                <td style="display:none">
                    <input name="ids" value="@item.Sp_ID" type="checkbox">
                </td>
                <td align="center">@num
                </td>
                <td align="center">
                    <a style="color:#000" href="@Url.Action("SpecialPersonnelDetail", "ScmSpecialPersonnel", new { id = item.Sp_ID })" rel="tzgl_zyry_detail" mask="true" target="dialog" width="480" height="320">@item.Sp_Name</a>
                </td>
                <td align="center">@item.Sp_Sex
                </td>
                <td align="center">@item.Sp_Work
                </td>
                <td align="center">@(item.Sp_CertificateDate == null ? "" : Convert.ToDateTime(item.Sp_CertificateDate).ToString("yyyy-MM-dd"))
                </td>
                <td align="center">@(item.Sp_ValidityDate == null ? "" : Convert.ToDateTime(item.Sp_ValidityDate).ToString("yyyy-MM-dd"))
                </td>
                <td align="center">@item.Sp_CertificateNumb
                </td>
                <td align="center">@(item.Sp_EnterDate == null ? "" : Convert.ToDateTime(item.Sp_EnterDate).ToString("yyyy-MM-dd"))
                </td>
                <td align="center">@(item.Sp_ExitDate == null ? "" : Convert.ToDateTime(item.Sp_ExitDate).ToString("yyyy-MM-dd"))
                </td>
            </tr>
               
        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom: none;">
    <div class="pages"  style="float: right">
        <span>显示</span>
        <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'tzgl_zyry_list')">
            <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="tzgl_zyry_list" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
